package se.wangs.decorator.abstracttype.decorators;

import se.wangs.decorator.abstracttype.Beverage;
import se.wangs.decorator.abstracttype.CondimentDecorator;

/**
 * -- coding: UTF-8 -- *
 *
 * @author wangs
 * @date 2023/12/11 15:32
 * @description 加豆浆
 */
public class Soy extends CondimentDecorator {

    protected Beverage beverage;

    public Soy(Beverage beverage) {
        this.beverage = beverage;
    }

    @Override
    public double cost() {
        return 0.15 + beverage.cost();
    }

    @Override
    public String getName() {
        return beverage.getName() + ", Soy";
    }
}
